<h1>New post</h1>

<% form_for @post, :url => { :action => "create" }  do |f| %>
  <%= f.error_messages %>

  <p>
    <%= f.label :title %><br />
    <%= f.text_field :title %>
  </p>
  <p>
    <%= f.label :body %><br />
    <%= f.text_area :body %>
  </p>
  <p>
    <%= f.label :published %><%= f.check_box :published %><br />
  </p>
  <p>
    <%= f.label :close_comment %><%= f.check_box :close_comment %><br />
  </p>
  <p>
    <%= f.label :category_id %><br />
    <%= f.select :category_id, @categories %>
  </p>
  <p>
    <%= f.label :tag_id %><br />
    <%= f.text_field :tag_id %>
  </p>
  <p>
    <%= f.submit "确定" %>
    
  </p>
<% end %>

<%= link_to '回到文章列表', admin_posts_path %>
